Intelligent Gateway For The Internet Of Things